package MyGO.Form;

import MyGO.property.CheckPro;
import MyGO.utils.DateTimeUtils.DateTimeUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import static MyGO.utils.DateTimeUtils.getTime.getDateTime;


@Data
@AllArgsConstructor
public class CheckForm {
    String id;
    Double fee;
    List<String> checkProIDs;
    HashMap<String, String> isPayMent;
    String creatTime = null;
    String finishTime = null;
    String aim = null;
    String checkPart = null;
    String remark = null;
    String checkResult = null;

    public CheckForm() {
        creatTime = getDateTime();
        this.checkProIDs = new ArrayList<>();
        this.isPayMent = new HashMap<>();
        this.fee = 0.0;
    }

    public void addCheck(CheckPro checkPro) {
        checkProIDs.add(checkPro.getId());
        isPayMent.put(checkPro.getId(), "未缴费");
        fee += checkPro.getPrice();
    }

    public void finish() {
        this.finishTime = getDateTime();
    }
}
